home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1999 #2 / Amiga Plus CD - 1999 - No. 2.iso / System-Boost / Grafik / AmiCAD / ARexx_english / SavePalette.AmiCAD < prev    next >
Text File  |  1998-06-17  |  778b  |  35 lines

  1. /* Sauve the current palette in a file */
  2. /* The file can be loaded using the menu Preferences/Configuration/Load */
  3. /* $VER: 1.00e (© R.Florac, Chez Corbin, 24 mai 1998) */
  4.  
  5. options results
  6.  
  7. signal on error
  8. signal on syntax
  9.  
  10. 'REQFILE("Name of the destination file?", "")'; fichier=result
  11. if fichier ~="" then do
  12.     if open(file, fichier, 'W') then do
  13.     call writeln(file, "AmiCADPrefs 1.1")
  14.     call writeln(file, "[Palette]")
  15.     do color=0 to 15
  16.         c="Color"||color||"="
  17.         'GETCOLOR('color')'; c=c||result
  18.         call writeln(file,c)
  19.     end
  20.     close(file)
  21.     end
  22. end
  23.  
  24. exit
  25.  
  26. /* Traitement des erreurs, interruption du programme */
  27. syntax:
  28. erreur=RC
  29. 'MESSAGE("Syntax error"+CHR(10)+"in line 'SIGL'"+CHR(10)+"'errortext(erreur)'")'
  30. exit
  31.  
  32. error:
  33. 'MESSAGE("Error in line 'SIGL'")'
  34. exit
  35.